

# 按照以下条件进行过滤 
#   1. 进程名
#   2. 进程id
$process = "chrome.exe"
$processId = 123
Get-WmiObject Win32_Process -Filter "name = '$process'" | Select-Object CommandLine
Get-WmiObject Win32_Process -Filter "ProcessId=$processId"

# 过滤出所有的chrome进程, 找出其启动命令行参数
Get-Process | Where-Object{$_.name -like 'chrome'} | ForEach-Object{Get-WmiObject Win32_Process -Filter "ProcessId=$($_.id)"} | Select-Object CommandLine
